package ooo.reindeer.springboot.starter.cedf;


import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(CedfService.class)
@ComponentScan(value = "ooo.reindeer.springboot.starter.cedf")
public class CedfAutoConfiguration implements CommandLineRunner {

    private static final String clazzName = "ooo.reindeer.cedf.Cedf";


    @Bean(initMethod = "init", destroyMethod = "destroy")
    CedfService cedfService() {
        CedfService service = new CedfService();
//        service.setComponentLoader(new ComponentsLoader());
        return service;
    }

    @Override
    public void run(String... args) throws Exception {

        Class.forName(clazzName);
    }
}
